Scala List Interview Question